# Part of Odoo. See LICENSE file for full copyright and licensing details.

from odoo import _, api, fields, models


class PaymentProvider(models.Model):
    _inherit = 'payment.provider'
 

    code = fields.Selection(
        selection_add=[('zhifubao', "支付宝")], ondelete={'zhifubao': 'set default'}
    )
     
 
 

    def _get_default_payment_method_codes(self):
        """ Override of `payment` to return the default payment method codes. """
        default_codes = super()._get_default_payment_method_codes()
        if self.code != 'zhifubao':
            return default_codes
        return {'zhifubao'}
